package ar.com.tallerdos.smartdinner.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import ar.com.tallerdos.smartdinner.R;
import ar.com.tallerdos.smartdinner.sync.RubrosSincronizador;

public class MainMenuActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	// setContentView(R.layout.main_menu_activity);

	setContentView(R.layout.comida_activity);

	ListView listview = (ListView) findViewById(R.id.pedidosListado);
	TextView header = (TextView) findViewById(R.id.comidaHeader);
	
	header.setText("HOL AAAAAAAAAAAAAAAAAAAAAAA");

	listview.setAdapter(new ArrayAdapter<Integer>(this,
		android.R.layout.simple_list_item_1, new Integer[] {}));
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
	// Inflate the menu; this adds items to the action bar if it is present.
	getMenuInflater().inflate(R.menu.main_menu, menu);
	return true;
    }

    public void addItem(View view) {
	// Intent intent = new Intent(this, ListViewExampleActivity.class);
	Intent intent = new Intent(this, RubrosLista.class);
	startActivity(intent);

    }

    public void sync(View view) {

	RubrosSincronizador dlTask = new RubrosSincronizador();
	dlTask.execute();
    }
}
